@extends('admin.frame_layout')
<?php $top_selected = "模式管理";$page_menu = "系统功能开关" ?>
@section('content')
    <div class="formbody">
        <div class="formtitle"><span>系统功能开关设置</span></div>
        <form action="{{route('admin.config.save')}}" method="post" id="site">
            {!! csrf_field() !!}
            <input type="hidden" name="_title" value="switch"/>

            <ul class="forminfo">
                <li>
                    <label class="lable">会员注册</label>
                    <cite>
                        <input name="reg_user" type="radio"
                               value="1" {{cv("switch.reg_user")==1?"checked":""}}/>&nbsp;&nbsp;开启&nbsp;&nbsp;&nbsp;&nbsp;
                        <input name="reg_user" type="radio"
                               value="0" {{cv("switch.reg_user")==0?"checked":""}}/>&nbsp;&nbsp;关闭
                    </cite>
                </li>
                <li>
                    <label class="lable">会员报单</label>
                    <cite>
                        <input name="act_user" type="radio"
                               value="1" {{cv("switch.act_user")==1?"checked":""}}/>&nbsp;&nbsp;开启&nbsp;&nbsp;&nbsp;&nbsp;
                        <input name="act_user" type="radio"
                               value="0" {{cv("switch.act_user")==0?"checked":""}}/>&nbsp;&nbsp;关闭
                    </cite>
                </li>
                <li>
                    <label class="lable">报单中心申请</label>
                    <cite>
                        <input name="apply_bdzx" type="radio"
                               value="1" {{cv("switch.apply_bdzx")==1?"checked":""}}/>&nbsp;&nbsp;开启&nbsp;&nbsp;&nbsp;&nbsp;
                        <input name="apply_bdzx" type="radio"
                               value="0" {{cv("switch.apply_bdzx")==0?"checked":""}}/>&nbsp;&nbsp;关闭
                    </cite>
                </li>
                <li>
                    <label class="lable">会员转账</label>
                    <cite>
                        <input name="transfer" type="radio"
                               value="1" {{cv("switch.transfer")==1?"checked":""}}/>&nbsp;&nbsp;开启&nbsp;&nbsp;&nbsp;&nbsp;
                        <input name="transfer" type="radio"
                               value="0" {{cv("switch.transfer")==0?"checked":""}}/>&nbsp;&nbsp;关闭
                    </cite>
                </li>
                <li>
                    <label class="lable">会员提现</label>
                    <cite>
                        <input name="withdraw" type="radio"
                               value="1" {{cv("switch.withdraw")==1?"checked":""}}/>&nbsp;&nbsp;开启&nbsp;&nbsp;&nbsp;&nbsp;
                        <input name="withdraw" type="radio"
                               value="0" {{cv("switch.withdraw")==0?"checked":""}}/>&nbsp;&nbsp;关闭
                    </cite>
                </li>
                <li>
                    <label class="lable">币种转换</label>
                    <cite>
                        <input name="coin_switch" type="radio"
                               value="1" {{cv("switch.coin_switch")==1?"checked":""}}/>&nbsp;&nbsp;开启&nbsp;&nbsp;&nbsp;&nbsp;
                        <input name="coin_switch" type="radio"
                               value="0" {{cv("switch.coin_switch")==0?"checked":""}}/>&nbsp;&nbsp;关闭
                    </cite>
                </li>
                <li>
                    <label class="lable">打款申请</label>
                    <cite>
                        <input name="remit" type="radio"
                               value="1" {{cv("switch.remit")==1?"checked":""}}/>&nbsp;&nbsp;开启&nbsp;&nbsp;&nbsp;&nbsp;
                        <input name="remit" type="radio"
                               value="0" {{cv("switch.remit")==0?"checked":""}}/>&nbsp;&nbsp;关闭
                    </cite>
                </li>
                <li>
                    <label class="lable">商城购物</label>
                    <cite>
                        <input name="shopping" type="radio"
                               value="1" {{cv("switch.shopping")==1?"checked":""}}/>&nbsp;&nbsp;开启&nbsp;&nbsp;&nbsp;&nbsp;
                        <input name="shopping" type="radio"
                               value="0" {{cv("switch.shopping")==0?"checked":""}}/>&nbsp;&nbsp;关闭
                    </cite>
                </li>
                <li>
                    <label class="lable">&nbsp;</label>
                    <input type="submit" class="btn" value="确认保存"/>
                </li>
            </ul>
        </form>
    </div>
@endsection
@section('footer')
    <script>
        $("#site").validate({
            rules: {
                site_name: "required",
                site_open: "required",
                site_intro: {
                    minlength: 10
                }
            }, errorPlacement: function (error, element) {
                $(element).closest("form").find("i[for='" + element.attr("id") + "']").html(error);
            },
            submitHandler: function (form) {
                $(form).ajaxSubmit({
                    dataType: "json",
                    type: "post",
                    success: function (data) {
                        if (data.code == 0) {
                            toastr["success"](data.msg);
                            setInterval(function () {
                                window.location.reload();
                            }, 2000);
                        } else {
                            toastr["error"](data.msg);
                        }
                    }
                });
            }
        });
    </script>
@endsection
